<template>
	<view class="classLayout pageBg">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="classify">
			<theme-item v-for="(item,index) in classifyList" :key="item._id" :items="item"></theme-item>
		</view>

	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';

	import {
		onShareAppMessage,
		onShareTimeline
	} from "@dcloudio/uni-app"

	import {
		apiGetClassify
	} from '@/api/apis.js';
	// 分类
	const classifyList = ref([])
	const getClassify = async () => {
		let res = await apiGetClassify({
			pageSize: 15
		})
		classifyList.value = res.data
		console.log(res)
		console.log(2)
	}

	// 分享好友
	onShareAppMessage((e) => {
		console.log(e)
		return {
			title: '虾米壁纸分类',
			path: '/pages/classify/classify'
		}
	})

	// 分享朋友圈
	onShareTimeline(() => {
		return {
			title: "虾米壁纸分类。。。",
			// imageUrl:'http://gips0.baidu.com/it/u=3602773692,15mt=auto?w=960&h=1280'
			// imageUrl:'/static/images/xxmLogo.png',
			imageUrl: bannaerList.value[0].picurl

		}
	})

	getClassify()
</script>

<style lang="scss" scoped>
	.classify {
		padding: 30rpx;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 15rpx;
	}
</style>